﻿using Abp.BackgroundJobs;
using Abp.Dependency;
using Abp.Domain.Uow;
using Abp.Threading;
using DHJ.Cost.CostAccounting.Cache;

namespace DHJ.Cost.CostAccounting.Job
{
    public class AnnualCostAnalysisJob : BackgroundJob<int>, ITransientDependency
    {

        private readonly CostAccountingCache _costAccountingCache;

        public AnnualCostAnalysisJob(CostAccountingCache costAccountingCache)
        {
            _costAccountingCache = costAccountingCache;
        }

        [UnitOfWork]
        public override void Execute(int args)
        {
            AsyncHelper.RunSync(() => _costAccountingCache.InitAnnualCostCache());
        }
    }
}
